package com.sugar.psych.assessment.module.business.dal.mysql.psychquestionbank;

import java.util.*;

import com.sugar.psych.assessment.framework.common.pojo.PageResult;
import com.sugar.psych.assessment.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.psych.assessment.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.psych.assessment.module.business.dal.dataobject.psychquestionbank.PsychQuestionBankDO;
import org.apache.ibatis.annotations.Mapper;
import com.sugar.psych.assessment.module.business.controller.admin.psychquestionbank.vo.*;

/**
 * 心理测评题库 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface PsychQuestionBankMapper extends BaseMapperX<PsychQuestionBankDO> {

    default PageResult<PsychQuestionBankDO> selectPage(PsychQuestionBankPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PsychQuestionBankDO>()
                .eqIfPresent(PsychQuestionBankDO::getTitle, reqVO.getTitle())
                .eqIfPresent(PsychQuestionBankDO::getRiskLevel, reqVO.getRiskLevel())
                .eqIfPresent(PsychQuestionBankDO::getExtractCount, reqVO.getExtractCount())
                .betweenIfPresent(PsychQuestionBankDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PsychQuestionBankDO::getId));
    }

}